#include <QtGui/QApplication>

#include "mainwindow.h"
#include "mysettings.h"
#include "tapp.h"

int main(int argc, char *argv[])
{
    Q_INIT_RESOURCE(images);

    MyApp a(argc, argv);

    if (!QSystemTrayIcon::isSystemTrayAvailable())
    {
        QMessageBox::critical(0, QObject::tr("USBRefresher"),
                              QObject::tr("Couldn't detect any system tray on this system."));
        return 1;
    }

    MyApp::setQuitOnLastWindowClosed(false);

    MainWindow w;
    a.connect ( &a, SIGNAL(newVolumeDevice(const QString &, int)), &w, SLOT(deviceArrived( const QString &, int)) );
    if ( !mySettings::getSilentRunMode() )
        w.show();
    return a.exec();
}
